//
//  HomeViewController.m
//  quickDoctor
//
//  Created by zhaowei on 17/3/8.
//  Copyright © 2017年 SWS. All rights reserved.
//

#import "HomeViewController.h"
#import "WeatherView.h"
<<<<<<< HEAD
#import "LocationTableController.h"
#import "CycllingView.h"

=======
#import "SJPDepartmentView.h"
>>>>>>> c7b19bac797f173dfeda34ce94dbeb2403a6ff59

@interface HomeViewController ()

@property (nonatomic,strong)UIView *weView;
@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}
- (void)setupUI {
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.title = @"马医一生";
     self.navigationController.navigationBar.barTintColor = kThemeColor;
    
    //先添加一个view
    WeatherView *weView = [[WeatherView alloc] init];
    _weView = weView;
    weView.backgroundColor = RGBACOLOR(172, 239, 220, 1);
    [self.view addSubview:weView];
    
    //布局
    [weView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(64);
        make.leading.trailing.offset(0);
        make.height.mas_equalTo(80);
    }];
<<<<<<< HEAD
=======
     [self setupDepartmentView];

>>>>>>> 68b11ef991042f25c6a8d6e7bbd7f5c2afd9ff53
    
    
    
    
<<<<<<< HEAD
    
    
    
    
    
    
    
    
    [self setupDepartmentView];
=======
    //接收通知
    [[NSNotificationCenter defaultCenter] addObserver:self  selector:@selector(clickChose) name:@"push" object:nil];
    
    //添加轮播视图
    [self addCycleView];
}

- (void)addCycleView {
    
    CycllingView *cycle = [[CycllingView alloc] init];
    
    
    [self.view addSubview:cycle];
    //布局
    [cycle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_weView.mas_bottom);
        make.leading.trailing.offset(0);
        make.height.mas_equalTo(180);
    }];
}
/// 点击跳转
- (void)clickChose {
    
    //创建tableController
    LocationTableController *locController = [[LocationTableController alloc] init];
    
    [self.navigationController pushViewController:locController animated:YES];
    

    
    
>>>>>>> 68b11ef991042f25c6a8d6e7bbd7f5c2afd9ff53
    
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
























































#pragma
#pragma-添加department控制器

- (void)setupDepartmentView
{
    //设置frame
    CGFloat viewY = self.view.height / 2;
    
    SJPDepartmentView *departmentView = [[SJPDepartmentView alloc]initWithFrame:CGRectMake(0, viewY, self.view.width, self.view.height/2)];
    
    [self.view addSubview:departmentView];
    departmentView.backgroundColor = [UIColor lightGrayColor];
    [self addChildViewController:departmentView.childContrller];
    
    
    
}

@end
